<template>
  <div style="width: auto">
    <el-row>
      <el-col :span="4">
        <el-menu
            default-active="2"
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose">
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span slot="title">视频</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="1-1">推荐</el-menu-item>
              <el-menu-item index="1-2">关注</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-menu-item index="2">
            <i class="el-icon-menu"></i>
            <span slot="title">观看历史</span>
          </el-menu-item>
          <el-menu-item index="3">
            <i class="el-icon-document"></i>
            <span slot="title">精彩频道</span>
          </el-menu-item>
        </el-menu>
      </el-col>
      <el-col :span="20">
        <!--          走马灯-->
        <div>
          <el-carousel :interval="4000" type="card" height="200px">
            <el-carousel-item v-for="imageUrl in urls" :key="imageUrl">
              <img :src="imageUrl" alt="carousel image" style="width: 100%; height: 200px; object-fit: cover;">
            </el-carousel-item>
          </el-carousel>
        </div>

        <h2>推荐视频</h2>

        <div style="display: flex;flex-wrap: wrap">
          <div style="width: 270px;margin-right: 30px;margin-top: 20px" v-for="item in videoUrl" :key="item">
            <el-card>
              <div>
                <!--                     :poster="item.image"-->
                <video id="myVideo" controls
                       preload="auto"
                       muted =true
                       width="100%">
                  <source :src="item.video" type="video/mp4">
                </video>
              </div>

              <p><b>{{ item.content }}</b></p>

              <div style="display: flex;margin-top: 20px">
                <el-avatar :size="30" :src="imgUrl"></el-avatar>
                <div class="video_text">
                  <p><el-link :underline="false">{{item.username}}</el-link></p>
                  <p>{{item.created}}</p>
                </div>
              </div>
            </el-card>
          </div>
        </div>


      </el-col>
    </el-row>

  </div>
</template>

<script>
export default {
  data() {
    return {
      user: {},
      urls: [
        'https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg',
        'https://fuss10.elemecdn.com/1/34/19aa98b1fcb2781c4fba33d850549jpeg.jpeg',
        'https://fuss10.elemecdn.com/0/6f/e35ff375812e6b0020b6b4e8f9583jpeg.jpeg',
        'https://fuss10.elemecdn.com/9/bb/e27858e973f5d7d3904835f46abbdjpeg.jpeg',
        'https://fuss10.elemecdn.com/d/e6/c4d93a3805b3ce3f323f7974e6f78jpeg.jpeg',
        'https://fuss10.elemecdn.com/3/28/bbf893f792f03a54408b3b7a7ebf0jpeg.jpeg',
        'https://fuss10.elemecdn.com/2/11/6535bcfb26e4c79b48ddde44f4b6fjpeg.jpeg'
      ],
      videoUrl:[
        {video:require("/public/video/iBTn8wjk.mp4"),image:require("/public/static/image.jpg"),username:"万大时",created:'2024年10月15日 20时01分00秒',content:'红酒杯'},
        {video:require("/public/video/iBTn8wjk.mp4"),image:require("/public/static/image.jpg"),username:"万大时",created:'2024年10月15日 20时01分00秒',content:'红酒杯'},
        {video:require("/public/video/iBTn8wjk.mp4"),image:require("/public/static/image.jpg"),username:"万大时",created:'2024年10月15日 20时01分00秒',content:'红酒杯'},
        {video:require("/public/video/iBTn8wjk.mp4"),image:require("/public/static/image.jpg"),username:"万大时",created:'2024年10月15日 20时01分00秒',content:'红酒杯'},
      ],
      imgUrl: 'https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg',

    }
  }
}
</script>


<style scoped>
.video_text p{
  font-size: 12px;
  color: rgba(100,100,100,0.7);
  margin-left: 10px;
}

.el-carousel__item h3 {
  color: #475669;
  font-size: 14px;
  opacity: 0.75;
  line-height: 150px;
  margin: 0;
}

.el-carousel__item:nth-child(2n) {
  /*background-color: #99a9bf;*/
}

.el-carousel__item:nth-child(2n+1) {
  /*background-color: #d3dce6;*/
}
</style>